import { getChannelAPI } from "@/apis/article"
import { useEffect, useState } from "react"

// 封装获取频道列表的逻辑
function useChannel() {
    const [channelList, setChannelList] = useState([])
    useEffect(() => {
        const getChanngelList = async () => {
            const res = await getChannelAPI()
            setChannelList(res.data.channels)
        }
        getChanngelList()
    }, [])
    return { channelList, setChannelList }
}
export { useChannel }